package tool

import (
	"github.com/gin-gonic/gin"
	"net/http"
)

const(
	SUCCESS int =0  //操作成功
	FAIL int =1  //操作失败
)


func Success(c *gin.Context,r interface{}){
	c.JSON(http.StatusOK,map[string]interface{}{
		"code":SUCCESS,
		"msg":"成功",
		"data":r,
	})
}
func Failed(c *gin.Context,r interface{}){
	c.JSON(http.StatusOK,map[string]interface{}{
		"code":FAIL,
		"msg":r,
	})
}